package com.guanlin.notification.protect;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;

/**
 * author : changer
 * date   : 2020/3/30
 * desc   : 屏幕息屏 亮屏广播监听
 */
public class ScreenLockBroadcaseReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (TextUtils.equals(action, Intent.ACTION_SCREEN_OFF)) {

        } else if (TextUtils.equals(action, Intent.ACTION_SCREEN_ON)) {
//                Intent screenIntent = new Intent();
//                screenIntent.setClass(getApplication(), LockScreenActivity.class);
//                screenIntent.setPackage("com.guanlin.umengpush");
//                screenIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//                screenIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
//                screenIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
//                startActivity(screenIntent);
        }
    }
}
